package cz.muni.fi.pa165.pokemon.entity;

import cz.muni.fi.pa165.pokemon.dto.TrainerPosition;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;

/**
 *
 * @author xmravec1
 */
@Entity
@Table(name = "BADGE_STADIUM")
public class Stadium implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    //
    @ManyToOne
    private Badge badge;
    private String carType;
    @ManyToMany(fetch = FetchType.EAGER)
    private Map<TrainerPosition, Trainer> trainers;
    @ManyToMany(fetch = FetchType.EAGER)
    private Set<Pokemon> pokemons;
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private Date stadiumNewDate;
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private Date stadiumServicedDate;
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private Date stadiumPaidDate;
    private BigDecimal totalPrice;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Badge getBadge() {
        return badge;
    }

    public void setBadge(Badge badge) {
        this.badge = badge;
    }

    public String getCarType() {
        return carType;
    }

    public void setCarType(String carType) {
        this.carType = carType;
    }

    public Map<TrainerPosition, Trainer> getTrainers() {
        return trainers;
    }

    public void setTrainers(Map<TrainerPosition, Trainer> trainers) {
        this.trainers = trainers;
    }

    public Set<Pokemon> getPokemons() {
        return pokemons;
    }

    public void setPokemons(Set<Pokemon> pokemons) {
        this.pokemons = pokemons;
    }

    public Date getStadiumNewDate() {
        return stadiumNewDate;
    }

    public void setStadiumNewDate(Date stadiumNewDate) {
        this.stadiumNewDate = stadiumNewDate;
    }

    public Date getStadiumServicedDate() {
        return stadiumServicedDate;
    }

    public void setStadiumServicedDate(Date stadiumServicedDate) {
        this.stadiumServicedDate = stadiumServicedDate;
    }

    public Date getStadiumPaidDate() {
        return stadiumPaidDate;
    }

    public void setStadiumPaidDate(Date stadiumPaidDate) {
        this.stadiumPaidDate = stadiumPaidDate;
    }

    public BigDecimal getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(BigDecimal totalPrice) {
        this.totalPrice = totalPrice;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof Stadium)) {
            return false;
        }
        Stadium other = (Stadium) object;
        if ((this.id == null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Stadium{" + "id=" + id + ", badge=" + badge + ", carType=" + carType + ", trainers=" + trainers + ", pokemons=" + pokemons + ", stadiumNewDate=" + stadiumNewDate + ", stadiumServicedDate=" + stadiumServicedDate + ", stadiumPaidDate=" + stadiumPaidDate + ", totalPrice=" + totalPrice + '}';
    }

}
